using System;
using System.IO;
using Common.Core.Serialization;

namespace Common.Unity.Extensions.Serialization
{
	public class XamlSerializationPolicy : SerializationPolicyBase
	{
		public XamlSerializationPolicy( IStreamResolver resolver ) : base( resolver )
		{}

		protected override object Deserialize( Type targetType, Stream stream )
		{
			var serializer = new XamlSerializationHelper();
			var result = serializer.Load( stream );
			return result;
		}
	}
}